#include "myitem.h"
#include<QPixmap>
#include<QDebug>
#include "handle.h"

myitem::myitem()
{
    this->setPixmap(QPixmap(":/Images/Img/hole.png"));
}
void myitem::setPic(QString path){
    this->setPixmap(QPixmap(path));
}

void myitem::mousePressEvent(QGraphicsSceneMouseEvent* event){
    handle* hand=handle::getinstance();
    if(this->ismice()){
        hand->addscore();
        this->setPixmap(QPixmap(":/Images/Img/hole.png"));
    }
    else{

    }
}
void myitem::setmice(bool mice){
    this->mice=mice;
}
bool myitem::ismice(){
    return this->mice;
}
